
export const getTotalPrice = (list) => {
  const totalPrice = list.reduce((num, item) => {
    return num + item.number * item.price
  }, 0)
  return totalPrice.toFixed(2) * 100
}

// 手机号中间加密函数
export const crytoPhone = (phone) => {
  return phone.replace(/(\d{3})(\d{4})(\d{4})/, "$1****$3")
}

// 获取当前页面的路径
export const getCurrentPage = () => {
  const pages = getCurrentPages()
  return pages.pop().route
}